public class World
{
  public int width = 500, height = 500;
  public PApplet parent;
  public OBJModel tree;
  public World(PApplet parent)
  {
    this.parent = parent;
    tree = new OBJModel(parent, "Tree//test.obj", "absolute", POLYGON);
    tree.scale(10);
    tree.enableMaterial();
    //tree.enableTexture();
  }

  public void Draw()
  {
    pushMatrix();
    translate(-width/2, 1, -height/2);
    DrawGround(0, 0, width, height);
    //stroke(100);
    noFill();

    translate(width/2, -0.5f, height/2);
    //new BoundingBox(parent, tree).draw();
    tree.draw();
    noStroke();
    popMatrix();
  }

  public void DrawGround(int x, int y, int w, int h)
  {
    fill(255);
    beginShape();
    vertex(x, 0, y);
    vertex(x+w, 0, y);
    vertex(x, 0, y+h);
    endShape();

    beginShape();
    vertex(x, 0, y+h);
    vertex(x+w, 0, y);
    vertex(x+w, 0, y+h);
    endShape();
  }
}

